package bestTeam.WalkieDoggie.client;

import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.MenuItem;

import bestTeam.WalkieDoggie.client.Serializables.LoginInfo;

public class LoginPage {
	public static LoginInfo loginInfo = null;	

	/**
	 * @wbp.parser.entryPoint
	 */
	public void loadLoginPage(String rootPanelId,String loginUrl)
	{
		// Use RootPanel.get() to get the entire body element

		WalkieDoggie.mainPanel = RootPanel.get(rootPanelId);	


		VerticalPanel verticalPanel = new VerticalPanel();
		//WalkieDoggie.mainPanel.add(verticalPanel, 15, 17);
		WalkieDoggie.mainPanel.add(verticalPanel);
		verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		verticalPanel.setSize("97%", "590px");

		//		Frame fbFrame = new Frame("https://www.facebook.com/plugins/registration?"+
		//				"client_id=141266756000631&"+
		//				"redirect_uri=https://walkie-doggie.appspot.com/&"+
		//				"fields=" +
		//				"["+
		//				"{'name':'name'},"+
		//				"{'name':'email'},"+
		//				"{'name':'gender'},"+
		//				"{'name':'location'},"+
		//				"{'name':'street',      'description':'Street',             'type':'text'},"+
		//				"{'name':'house_number',      'description':'House Number',             'type':'text'},"+
		//				"{'name':'phone',      'description':'Phone Number',             'type':'text'}"+
		//				"]");
		//				
		//		fbFrame.setHeight("100%");
		//		fbFrame.setWidth("100%");
		//		verticalPanel.add(fbFrame);


		HorizontalPanel horizontalPanel = new HorizontalPanel();
		verticalPanel.add(horizontalPanel);
		verticalPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_LEFT);
		horizontalPanel.setSize("100%", "");

		Image image = new Image("thinlogo.png");
		horizontalPanel.add(image);
		horizontalPanel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE);
		image.setSize("637px", "100px");

		HorizontalPanel horizontalPanel_1 = new HorizontalPanel();		
		verticalPanel.add(horizontalPanel_1);
		horizontalPanel_1.setSize("100%", "");

		MenuBar menuBar = new MenuBar(false);		
		horizontalPanel_1.add(menuBar);
		menuBar.setSize("100%", "");
		
		MenuItem mntmNewItem = new MenuItem("New item", false, new Command() {
			public void execute() {
			}
		});
		mntmNewItem.setEnabled(false);
		mntmNewItem.addStyleName("wd-menu-item");
		mntmNewItem.setHTML("Welcome to Walkie Doggie!");
		menuBar.addItem(mntmNewItem);

		HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
		horizontalPanel_2.setSpacing(10);
		verticalPanel.add(horizontalPanel_2);
		horizontalPanel_2.setSize("780px", "100%");
		horizontalPanel_2.setStyleName("login_table");

		VerticalPanel verticalPanel_1 = new VerticalPanel();
		horizontalPanel_2.add(verticalPanel_1);
		verticalPanel_1.setSize("400px", "100%");

//		Image image_2 = new Image("walkieWelcome.png");
//		verticalPanel_1.add(image_2);
//		verticalPanel_1.setCellHeight(image_2, "100");
//		verticalPanel_1.setCellWidth(image_2, "250");
//		image_2.setSize("250", "50px");

		HorizontalPanel horizontalPanel_4 = new HorizontalPanel();
		verticalPanel_1.add(horizontalPanel_4);
		horizontalPanel_4.setWidth("100%");
		
		Label lblDontHaveTime = new Label("We help create a dog walking community in your neighbourhood.");
		lblDontHaveTime.setWordWrap(false);
		lblDontHaveTime.setStyleName("login_table_item");
		horizontalPanel_4.add(lblDontHaveTime);
		lblDontHaveTime.setSize("100%", "");

		HorizontalPanel horizontalPanel_5 = new HorizontalPanel();
		verticalPanel_1.add(horizontalPanel_5);
		
		Label lblNewLabel = new Label("Help each other out, and find 4-legged friends for you dog!");
		lblNewLabel.setStyleName("login_table_item");
		horizontalPanel_5.add(lblNewLabel);
		lblNewLabel.setHeight("100%");
		
		HorizontalPanel horizontalPanel_6 = new HorizontalPanel();
		horizontalPanel_6.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);		
		horizontalPanel_2.add(horizontalPanel_6);		

		Image image_1 = new Image("facebookButton.png");
		image_1.setStyleName("handCursor");
		image_1.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				Window.Location.assign(Facebook.getLoginRedirectURL());
			}
		});

		
//		Anchor tmpLoginLink = new Anchor("Temp login link");
//		tmpLoginLink.setHref(Facebook.getLoginRedirectURL());
//		verticalPanel_2.add(tmpLoginLink);
//		

		
		horizontalPanel_6.add(image_1);
		
		HorizontalPanel horizontalPanel_7 = new HorizontalPanel();
		horizontalPanel_7.setStyleName("steps-title-table");
		horizontalPanel_7.setSpacing(10);
		verticalPanel.add(horizontalPanel_7);
		horizontalPanel_7.setSize("100%", "100%");

		
		Label lblNewLabel_9 = new Label("The application is easy to use. Just follow 4 simple steps:");
		lblNewLabel_9.setStyleName("Bold_font");
		horizontalPanel_7.add(lblNewLabel_9);
		
		HorizontalPanel horizontalPanel_3 = new HorizontalPanel();
		horizontalPanel_3.setSpacing(25);
		verticalPanel.add(horizontalPanel_3);
		horizontalPanel_3.setHeight("100%");

		VerticalPanel verticalPanel_3 = new VerticalPanel();
		horizontalPanel_3.add(verticalPanel_3);
		verticalPanel_3.setWidth("153px");

		HorizontalPanel horizontalPanel_11 = new HorizontalPanel();
		verticalPanel_3.add(horizontalPanel_11);
		horizontalPanel_11.setSize("100%", "100%");
		
		Label lblNewLabel_1 = new Label("1. Create a Walkie");
		lblNewLabel_1.setStyleName("Bold_font");
		horizontalPanel_11.add(lblNewLabel_1);
		horizontalPanel_11.setCellHorizontalAlignment(lblNewLabel_1, HasHorizontalAlignment.ALIGN_CENTER);
		
		HorizontalPanel horizontalPanel_12 = new HorizontalPanel();
		verticalPanel_3.add(horizontalPanel_12);
		verticalPanel_3.setCellHorizontalAlignment(horizontalPanel_12, HasHorizontalAlignment.ALIGN_CENTER);
		
		Image image_3 = new Image("1.png");
		horizontalPanel_12.add(image_3);
		horizontalPanel_12.setCellHorizontalAlignment(image_3, HasHorizontalAlignment.ALIGN_CENTER);
		image_3.setSize("153px", "116px");
		
		HorizontalPanel horizontalPanel_13 = new HorizontalPanel();
		verticalPanel_3.add(horizontalPanel_13);
		
		Label lblNewLabel_2 = new Label("Login and create a Walkie request for when you need your dog walked.\t");
		horizontalPanel_13.add(lblNewLabel_2);
		horizontalPanel_13.setCellHorizontalAlignment(lblNewLabel_2, HasHorizontalAlignment.ALIGN_CENTER);
		lblNewLabel_2.setSize("100%", "100%");
		
		VerticalPanel verticalPanel_4 = new VerticalPanel();
		horizontalPanel_3.add(verticalPanel_4);
		verticalPanel_4.setSize("153px", "");
		
		HorizontalPanel horizontalPanel_8 = new HorizontalPanel();
		horizontalPanel_8.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel_4.add(horizontalPanel_8);
		horizontalPanel_8.setSize("100%", "100%");
		
		Label lblNewLabel_3 = new Label("2. View volunteers");
		lblNewLabel_3.setStyleName("Bold_font");
		horizontalPanel_8.add(lblNewLabel_3);
		horizontalPanel_8.setCellHorizontalAlignment(lblNewLabel_3, HasHorizontalAlignment.ALIGN_CENTER);
		lblNewLabel_3.setSize("153", "18");
		
		HorizontalPanel horizontalPanel_9 = new HorizontalPanel();
		verticalPanel_4.add(horizontalPanel_9);
		verticalPanel_4.setCellHorizontalAlignment(horizontalPanel_9, HasHorizontalAlignment.ALIGN_CENTER);
		
		Image image_4 = new Image("2.png");
		horizontalPanel_9.add(image_4);
		horizontalPanel_9.setCellHorizontalAlignment(image_4, HasHorizontalAlignment.ALIGN_CENTER);
		image_4.setSize("153px", "116px");
		
		HorizontalPanel horizontalPanel_10 = new HorizontalPanel();
		verticalPanel_4.add(horizontalPanel_10);
		
		Label lblNewLabel_4 = new Label("Neighbors see your request and volunteer to walk your dog along with theirs. ");
		horizontalPanel_10.add(lblNewLabel_4);
		horizontalPanel_10.setCellHorizontalAlignment(lblNewLabel_4, HasHorizontalAlignment.ALIGN_CENTER);
		lblNewLabel_4.setHeight("100%");
		
		VerticalPanel verticalPanel_5 = new VerticalPanel();
		horizontalPanel_3.add(verticalPanel_5);
		verticalPanel_5.setWidth("153px");
		
		HorizontalPanel horizontalPanel_14 = new HorizontalPanel();
		horizontalPanel_14.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel_5.add(horizontalPanel_14);
		horizontalPanel_14.setWidth("100%");
		
		Label lblNewLabel_5 = new Label("3. Select a volunteer");
		lblNewLabel_5.setStyleName("Bold_font");
		horizontalPanel_14.add(lblNewLabel_5);
		horizontalPanel_14.setCellHorizontalAlignment(lblNewLabel_5, HasHorizontalAlignment.ALIGN_CENTER);
		
		HorizontalPanel horizontalPanel_15 = new HorizontalPanel();
		verticalPanel_5.add(horizontalPanel_15);
		verticalPanel_5.setCellHorizontalAlignment(horizontalPanel_15, HasHorizontalAlignment.ALIGN_CENTER);
		
		Image image_5 = new Image("3.png");
		horizontalPanel_15.add(image_5);
		horizontalPanel_15.setCellHorizontalAlignment(image_5, HasHorizontalAlignment.ALIGN_CENTER);
		image_5.setSize("153px", "116px");
		
		HorizontalPanel horizontalPanel_16 = new HorizontalPanel();
		verticalPanel_5.add(horizontalPanel_16);
		
		Label lblNewLabel_6 = new Label("Select a volunteer according to facebook profile and user ratings.");
		horizontalPanel_16.add(lblNewLabel_6);
		horizontalPanel_16.setCellHorizontalAlignment(lblNewLabel_6, HasHorizontalAlignment.ALIGN_CENTER);
		
		VerticalPanel verticalPanel_6 = new VerticalPanel();
		horizontalPanel_3.add(verticalPanel_6);
		verticalPanel_6.setWidth("153px");
		
		HorizontalPanel horizontalPanel_17 = new HorizontalPanel();
		horizontalPanel_17.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel_6.add(horizontalPanel_17);
		horizontalPanel_17.setWidth("100%");
		
		Label lblNewLabel_7 = new Label("4. Problem solved!");
		lblNewLabel_7.setStyleName("Bold_font");
		horizontalPanel_17.add(lblNewLabel_7);
		horizontalPanel_17.setCellHorizontalAlignment(lblNewLabel_7, HasHorizontalAlignment.ALIGN_CENTER);
		
		HorizontalPanel horizontalPanel_18 = new HorizontalPanel();
		verticalPanel_6.add(horizontalPanel_18);
		verticalPanel_6.setCellHorizontalAlignment(horizontalPanel_18, HasHorizontalAlignment.ALIGN_CENTER);
		
		Image image_6 = new Image("4.png");
		horizontalPanel_18.add(image_6);
		horizontalPanel_18.setCellHorizontalAlignment(image_6, HasHorizontalAlignment.ALIGN_CENTER);
		image_6.setSize("153px", "116px");
		
		HorizontalPanel horizontalPanel_19 = new HorizontalPanel();
		verticalPanel_6.add(horizontalPanel_19);
		
		Label lblNewLabel_8 = new Label("Go out and have fun with no worries!");
		horizontalPanel_19.add(lblNewLabel_8);
		horizontalPanel_19.setCellHorizontalAlignment(lblNewLabel_8, HasHorizontalAlignment.ALIGN_CENTER);








		//		
		//		WalkieDoggie.mainPanel = RootPanel.get(rootPanelId);		
		//		
		//		VerticalPanel verticalPanel = new VerticalPanel();
		//		verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		//		WalkieDoggie.mainPanel.add(verticalPanel, 10, 10);
		//		verticalPanel.setSize("100%", "80px");
		//		
		//		Label lblNewLabel = new Label("Walkie-Doggie");
		//		lblNewLabel.setDirectionEstimator(true);
		//		lblNewLabel.setStylePrimaryName("dialogVPanel");
		//		lblNewLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		//		verticalPanel.add(lblNewLabel);
		//		lblNewLabel.setHeight("15%");
		//		
		//		Label lblNewLabel_1 = new Label("Who'll let the dog out? who, who, who!");
		//		lblNewLabel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		//		verticalPanel.add(lblNewLabel_1);
		//		lblNewLabel_1.setHeight("30px");
		//		
		//		HorizontalPanel horizontalPanel = new HorizontalPanel();
		//		verticalPanel.add(horizontalPanel);
		//		horizontalPanel.setSize("100%", "100px");
		//		
		//		Anchor hprlnkLogin = new Anchor("Click to Login", false);
		//		hprlnkLogin.setHref(loginUrl);
		//		hprlnkLogin.setWordWrap(false);		
		//		horizontalPanel.add(hprlnkLogin);
		//		hprlnkLogin.setWidth("167px");
		//		horizontalPanel.setCellVerticalAlignment(hprlnkLogin, HasVerticalAlignment.ALIGN_MIDDLE);
		//		horizontalPanel.setCellHorizontalAlignment(hprlnkLogin, HasHorizontalAlignment.ALIGN_CENTER);		
		//		
		//		Label lblNeedHelpWalking = new Label("Need help walking your dog? Tired of paying a fortune for dog walkers? This app will connect to other dog lovers in your neighborhood, and you can help eachother out!");
		//		lblNeedHelpWalking.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		//		horizontalPanel.add(lblNeedHelpWalking);
		//		horizontalPanel.setCellVerticalAlignment(lblNeedHelpWalking, HasVerticalAlignment.ALIGN_MIDDLE);


	}

}
